// 1. ------------------------- 获取成绩数据并展示 ---------------------------
axios.get('/score/list').then(result => {
  // console.log(result.data);
  let { code, data } = result.data;
  // console.log(data);
  if (code === 0) {
    let trs = ``;
    // 循环遍历，不断的去拼接tr
    for (let key in data) {
      // key 就是对象的键，即学员id    
      // data[key]表示 {name: '张三', score: [33, 44, 55, 66, 77]}
      trs += `
      <tr>
        <th scope="row">${key}</th>
        <td>${data[key].name}</td>
        <td class="score">${data[key].score[0]}</td>
        <td class="score">${data[key].score[1]}</td>
        <td class="score">${data[key].score[2]}</td>
        <td class="score">${data[key].score[3]}</td>
        <td class="score">${data[key].score[4]}</td>
      </tr>
      `;
    }
    // 循环结束，把所有的tr放到tbody中
    $('tbody').html(trs);
  }
});